/*
 * @Author: wuyuxin
 * @Date: 2022-01-09 17:22:15
 * @LastEditors: wuyuxin
 * @LastEditTime: 2022-01-09 17:45:46
 * @Description: 
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'

// Vue.config.productionTip = false

let instance = null

function render(props) {
  instance = new Vue({
    router,
    render: h => h(App)
  }).$mount('#app') // 这里挂载的还是挂载到自己的html标签中，基座会拿到这个挂载后的html,将其插入到基座中相应标签中
}

if (window.__POWERED_BY_QIANKUN__) { // 动态添加 publicPath
  __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
if (!window.__POWERED_BY_QIANKUN__) { // 默认独立运行
  render()
}

// 子组件的协议
export async function bootstrap(props){};

export async function mount(props){
  render(props)
};

export async function unmount(props){
  // console.log(instance)
  instance.$destroy()
};